<template>
  <div>
    <div v-if="show">
      <avic-bpm-steps :bpm-instance-object="bpmInstanceObject" />
    </div>
    <div v-else>
      <avic-bpm-chart :bpm-instance-object="bpmInstanceObject" />
    </div>
  </div>
</template>

<script>
import AvicBpmSteps from '../AvicBpmSteps/index.vue';
import AvicBpmChart from '../AvicBpmChart/index.vue';
export default {
  name: 'AvicBpmTrackAndChart',
  components: {
    AvicBpmChart,
    AvicBpmSteps
  },
  props: {
    isSteps: {
      type: Boolean,
      required: false, // 校验
      default: true
    },
    // 流程实例
    bpmInstanceObject: {
      type: Object,
      default: null
    }
  },
  data() {
    return {
      show: true
    };
  },
  watch: {
    isSteps: {
      immediate: true,
      handler(newVal, oldVal) {
        if (newVal !== oldVal) {
          this.show = newVal;
        }
      }
    }
  }
};
</script>
